﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace GUI
{
    [Serializable()]
    public class Button : BaseControl
    {
        private Vector2 _textPosition;
        private SpriteFont _font;
        private string _strfont;
        private string _text;

        public Button()
        { }

        public Vector2 TextPosition
        {
            get { return _textPosition; }
            set { _textPosition = value; }
        }

        [XmlIgnore()]
        public SpriteFont Font
        {
            get { return _font; }
            set { _font = value; }
        }

        public string FontAsset
        {
            get { return _strfont; }
            set { 
                _strfont = value;
                _font = Content.Load<SpriteFont>(_strfont);
                }
        }

        public string Text
        {
            get { return _text; }
            set { _text = value; }
        }

        public override void Draw(SpriteBatch sb)
        {
            base.Draw(sb);

            sb.DrawString(_font, Text,TextPosition, Color.Black);
        }
    }
}
